package com.zoweunion.mechanic.dao.base;

import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

@Mapper
@Component
public interface UpkeepDao {

	
	/**
	 * 根据id查询保养表数据
	 */
	Map<String,Object> getUpkeepById(Map<String, Object> reqMap);

	/**
	 * 根据id删除保养表数据
	 */
	int deleteUpkeepById(Map<String, Object> reqMap);

	/**
	 * 插入保养套餐
	 */
	int addUpkeep(Map<String, Object> reqMap);

	/**
	 * 插入t_s_br_upkeep_dictionaries
	 */
	int addUpkeep_dictionaries(Map<String, Object> reqMap);

	/**
	 * 编辑修改Upkeep
	 * @param reqMap
	 * @return
	 */
	int update(Map<String, Object> reqMap);

	/**
	 * 根据保养id删除相应的保养_配件关联数据
	 * @param reqMap 包含保养套餐id
	 */
	void delelteUpkeep_dictionaries(Map<String, Object> reqMap);

	/**
	 * 根据条件查询+分组过滤 +分页
	 * @param reqMap
	 * @return
	 */
	List<Map<String, Object>> pageQuery(Map<String, Object> reqMap);

	/**
	 * 查询分组过滤,条件过滤后的条数
	 * @param reqMap
	 * @return
	 */
	int countByCondition(Map<String, Object> reqMap);
	
	/**
	 * 根据条件分组后的条件查询所有时长
	 * @param reqMap brand car_type model
	 * @return id upkeep_time
	 */
	List<Map<String, Object>>getUpkeep_timeByCondition(Map<String, Object> reqMap);

	int deleteByCarInfo(Map<String, Object> reqMap);

	List<Map<String, Object>> getPartsByUpkeep_id(Map<String, Object> reqMap);

	List<Map<String, Object>> getUpkeepInfoByOrderId(Map<String, Object> reqMap);

    int countById(Map<String, Object> reqMap);

    List<Map<String, Object>> getUpkeepByModeId(Map<String, Object> reqMap);

    int countByModeId(Map<String, Object> reqMap);

    List<Map<String, Object>> pageQuery2(Map<String, Object> reqMap);

    int getUpkeepByTime(Map<String, Object> reqMap);
}
